﻿/*
 * EmeCoder v1.2.1.168
 * 作者：Administrator/PC4APPLE
 * 时间：2013-12-24 15:52:16
 * 版权：版权所有 (C) Eme Development Team 2013
*/

﻿using System;
using System.ComponentModel;
using HmFramework.Data;
using HmFramework.Data.Configuration;
using HmFramework.Data.DataAccessLayer;

namespace CuteSprite.Eme.Data.CRM
{
	/// <summary>收件人信息</summary>
	[Serializable]
	[DataObject]
	[Description("收件人信息")]
	[BindIndex("IX_ConsigneeInfo_Code_Address", false, "Code,Address")]
	[BindIndex("PK__CustomerConsigneeID__CDDC287C096E14F4", true, "ID")]
	[BindTable("ConsigneeInfo", Description = "收件人信息", ConnName = "EmeCRM", DbType = DatabaseType.SqlServer)]
	public abstract partial class ConsigneeInfo<TEntity> : IConsigneeInfo
	{
		#region 属性

		private Int32 _ID;

		/// <summary>主键</summary>
		[DisplayName("主键")]
		[Description("主键")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "ID", "主键", null, "int", 10, 0, false)]
		public virtual Int32 ID
		{
			get { return _ID; }
			set { if (OnPropertyChanging(__.ID, value)) { _ID = value; OnPropertyChanged(__.ID); } }
		}

		private String _Code;

		/// <summary>编号</summary>
		[DisplayName("编号")]
		[Description("编号")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn(2, "Code", "编号", null, "nvarchar(10)", 0, 0, true)]
		public virtual String Code
		{
			get { return _Code; }
			set { if (OnPropertyChanging(__.Code, value)) { _Code = value; OnPropertyChanged(__.Code); } }
		}

		private String _Name;

		/// <summary>名称</summary>
		[DisplayName("名称")]
		[Description("名称")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(3, "Name", "名称", null, "nvarchar(50)", 0, 0, true)]
		public virtual String Name
		{
			get { return _Name; }
			set { if (OnPropertyChanging(__.Name, value)) { _Name = value; OnPropertyChanged(__.Name); } }
		}

		private String _Address;

		/// <summary>地址</summary>
		[DisplayName("地址")]
		[Description("地址")]
		[DataObjectField(false, false, true, 400)]
		[BindColumn(4, "Address", "地址", null, "nvarchar(400)", 0, 0, true)]
		public virtual String Address
		{
			get { return _Address; }
			set { if (OnPropertyChanging(__.Address, value)) { _Address = value; OnPropertyChanged(__.Address); } }
		}

		private String _City;

		/// <summary>城市</summary>
		[DisplayName("城市")]
		[Description("城市")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(5, "City", "城市", null, "nvarchar(50)", 0, 0, true)]
		public virtual String City
		{
			get { return _City; }
			set { if (OnPropertyChanging(__.City, value)) { _City = value; OnPropertyChanged(__.City); } }
		}

		private String _PostCode;

		/// <summary>邮编</summary>
		[DisplayName("邮编")]
		[Description("邮编")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn(6, "PostCode", "邮编", null, "nvarchar(10)", 0, 0, true)]
		public virtual String PostCode
		{
			get { return _PostCode; }
			set { if (OnPropertyChanging(__.PostCode, value)) { _PostCode = value; OnPropertyChanged(__.PostCode); } }
		}

		private String _CountryCode;

		/// <summary>国家代码</summary>
		[DisplayName("国家代码")]
		[Description("国家代码")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(7, "CountryCode", "国家代码", null, "nvarchar(50)", 0, 0, true)]
		public virtual String CountryCode
		{
			get { return _CountryCode; }
			set { if (OnPropertyChanging(__.CountryCode, value)) { _CountryCode = value; OnPropertyChanged(__.CountryCode); } }
		}

		private String _Country;

		/// <summary>国家</summary>
		[DisplayName("国家")]
		[Description("国家")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(8, "Country", "国家", null, "nvarchar(50)", 0, 0, true)]
		public virtual String Country
		{
			get { return _Country; }
			set { if (OnPropertyChanging(__.Country, value)) { _Country = value; OnPropertyChanged(__.Country); } }
		}

		private String _Contact;

		/// <summary>联系人</summary>
		[DisplayName("联系人")]
		[Description("联系人")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(9, "Contact", "联系人", null, "nvarchar(50)", 0, 0, true)]
		public virtual String Contact
		{
			get { return _Contact; }
			set { if (OnPropertyChanging(__.Contact, value)) { _Contact = value; OnPropertyChanged(__.Contact); } }
		}

		private String _Telephone;

		/// <summary>电话</summary>
		[DisplayName("电话")]
		[Description("电话")]
		[DataObjectField(false, false, true, 20)]
		[BindColumn(10, "Telephone", "电话", null, "nvarchar(20)", 0, 0, true)]
		public virtual String Telephone
		{
			get { return _Telephone; }
			set { if (OnPropertyChanging(__.Telephone, value)) { _Telephone = value; OnPropertyChanged(__.Telephone); } }
		}

		private Boolean _IsDelete;

		/// <summary>逻辑删除</summary>
		[DisplayName("逻辑删除")]
		[Description("逻辑删除")]
		[DataObjectField(false, false, false, 1)]
		[BindColumn(13, "IsDelete", "逻辑删除", null, "bit", 0, 0, false)]
		public virtual Boolean IsDelete
		{
			get { return _IsDelete; }
			set { if (OnPropertyChanging(__.IsDelete, value)) { _IsDelete = value; OnPropertyChanged(__.IsDelete); } }
		}

		private DateTime _ModifiedOn;

		/// <summary>修改时间</summary>
		[DisplayName("修改时间")]
		[Description("修改时间")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(14, "ModifiedOn", "修改时间", null, "datetime", 3, 0, false)]
		public virtual DateTime ModifiedOn
		{
			get { return _ModifiedOn; }
			set { if (OnPropertyChanging(__.ModifiedOn, value)) { _ModifiedOn = value; OnPropertyChanged(__.ModifiedOn); } }
		}

		private Int32 _ModifiedUserID;

		/// <summary>修改用户ID</summary>
		[DisplayName("修改用户ID")]
		[Description("修改用户ID")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(15, "ModifiedUserID", "修改用户ID", null, "int", 10, 0, false)]
		public virtual Int32 ModifiedUserID
		{
			get { return _ModifiedUserID; }
			set { if (OnPropertyChanging(__.ModifiedUserID, value)) { _ModifiedUserID = value; OnPropertyChanged(__.ModifiedUserID); } }
		}

		private String _ModifiedBy;

		/// <summary>修改用户</summary>
		[DisplayName("修改用户")]
		[Description("修改用户")]
		[DataObjectField(false, false, false, 50)]
		[BindColumn(16, "ModifiedBy", "修改用户", null, "nvarchar(50)", 0, 0, true)]
		public virtual String ModifiedBy
		{
			get { return _ModifiedBy; }
			set { if (OnPropertyChanging(__.ModifiedBy, value)) { _ModifiedBy = value; OnPropertyChanged(__.ModifiedBy); } }
		}

		private DateTime _CreateOn;

		/// <summary>创建时间</summary>
		[DisplayName("创建时间")]
		[Description("创建时间")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(17, "CreateOn", "创建时间", null, "datetime", 3, 0, false)]
		public virtual DateTime CreateOn
		{
			get { return _CreateOn; }
			set { if (OnPropertyChanging(__.CreateOn, value)) { _CreateOn = value; OnPropertyChanged(__.CreateOn); } }
		}

		private Int32 _CreateUserID;

		/// <summary>创建用户ID</summary>
		[DisplayName("创建用户ID")]
		[Description("创建用户ID")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(18, "CreateUserID", "创建用户ID", null, "int", 10, 0, false)]
		public virtual Int32 CreateUserID
		{
			get { return _CreateUserID; }
			set { if (OnPropertyChanging(__.CreateUserID, value)) { _CreateUserID = value; OnPropertyChanged(__.CreateUserID); } }
		}

		private String _CreateBy;

		/// <summary>创建用户</summary>
		[DisplayName("创建用户")]
		[Description("创建用户")]
		[DataObjectField(false, false, false, 50)]
		[BindColumn(19, "CreateBy", "创建用户", null, "nvarchar(50)", 0, 0, true)]
		public virtual String CreateBy
		{
			get { return _CreateBy; }
			set { if (OnPropertyChanging(__.CreateBy, value)) { _CreateBy = value; OnPropertyChanged(__.CreateBy); } }
		}

		#endregion

		#region 获取/设置 字段值

		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case __.ID: return _ID;
					case __.Code: return _Code;
					case __.Name: return _Name;
					case __.Address: return _Address;
					case __.City: return _City;
					case __.PostCode: return _PostCode;
					case __.CountryCode: return _CountryCode;
					case __.Country: return _Country;
					case __.Contact: return _Contact;
					case __.Telephone: return _Telephone;
					case __.IsDelete: return _IsDelete;
					case __.ModifiedOn: return _ModifiedOn;
					case __.ModifiedUserID: return _ModifiedUserID;
					case __.ModifiedBy: return _ModifiedBy;
					case __.CreateOn: return _CreateOn;
					case __.CreateUserID: return _CreateUserID;
					case __.CreateBy: return _CreateBy;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case __.ID: _ID = Convert.ToInt32(value); break;
					case __.Code: _Code = Convert.ToString(value); break;
					case __.Name: _Name = Convert.ToString(value); break;
					case __.Address: _Address = Convert.ToString(value); break;
					case __.City: _City = Convert.ToString(value); break;
					case __.PostCode: _PostCode = Convert.ToString(value); break;
					case __.CountryCode: _CountryCode = Convert.ToString(value); break;
					case __.Country: _Country = Convert.ToString(value); break;
					case __.Contact: _Contact = Convert.ToString(value); break;
					case __.Telephone: _Telephone = Convert.ToString(value); break;
					case __.IsDelete: _IsDelete = Convert.ToBoolean(value); break;
					case __.ModifiedOn: _ModifiedOn = Convert.ToDateTime(value); break;
					case __.ModifiedUserID: _ModifiedUserID = Convert.ToInt32(value); break;
					case __.ModifiedBy: _ModifiedBy = Convert.ToString(value); break;
					case __.CreateOn: _CreateOn = Convert.ToDateTime(value); break;
					case __.CreateUserID: _CreateUserID = Convert.ToInt32(value); break;
					case __.CreateBy: _CreateBy = Convert.ToString(value); break;
					default: base[name] = value; break;
				}
			}
		}

		#endregion

		#region 字段名

		/// <summary>取得收件人信息字段信息的快捷方式</summary>
		public partial class _
		{
			///<summary>主键</summary>
			public static readonly Field ID = FindByName(__.ID);

			///<summary>编号</summary>
			public static readonly Field Code = FindByName(__.Code);

			///<summary>名称</summary>
			public static readonly Field Name = FindByName(__.Name);

			///<summary>地址</summary>
			public static readonly Field Address = FindByName(__.Address);

			///<summary>城市</summary>
			public static readonly Field City = FindByName(__.City);

			///<summary>邮编</summary>
			public static readonly Field PostCode = FindByName(__.PostCode);

			///<summary>国家代码</summary>
			public static readonly Field CountryCode = FindByName(__.CountryCode);

			///<summary>国家</summary>
			public static readonly Field Country = FindByName(__.Country);

			///<summary>联系人</summary>
			public static readonly Field Contact = FindByName(__.Contact);

			///<summary>电话</summary>
			public static readonly Field Telephone = FindByName(__.Telephone);

			///<summary>逻辑删除</summary>
			public static readonly Field IsDelete = FindByName(__.IsDelete);

			///<summary>修改时间</summary>
			public static readonly Field ModifiedOn = FindByName(__.ModifiedOn);

			///<summary>修改用户ID</summary>
			public static readonly Field ModifiedUserID = FindByName(__.ModifiedUserID);

			///<summary>修改用户</summary>
			public static readonly Field ModifiedBy = FindByName(__.ModifiedBy);

			///<summary>创建时间</summary>
			public static readonly Field CreateOn = FindByName(__.CreateOn);

			///<summary>创建用户ID</summary>
			public static readonly Field CreateUserID = FindByName(__.CreateUserID);

			///<summary>创建用户</summary>
			public static readonly Field CreateBy = FindByName(__.CreateBy);

			private static Field FindByName(String name)
			{
				return Meta.Table.FindByName(name);
			}
		}

		/// <summary>取得收件人信息字段名称的快捷方式</summary>
		public partial class __
		{
			///<summary>主键</summary>
			public const String ID = "ID";

			///<summary>编号</summary>
			public const String Code = "Code";

			///<summary>名称</summary>
			public const String Name = "Name";

			///<summary>地址</summary>
			public const String Address = "Address";

			///<summary>城市</summary>
			public const String City = "City";

			///<summary>邮编</summary>
			public const String PostCode = "PostCode";

			///<summary>国家代码</summary>
			public const String CountryCode = "CountryCode";

			///<summary>国家</summary>
			public const String Country = "Country";

			///<summary>联系人</summary>
			public const String Contact = "Contact";

			///<summary>电话</summary>
			public const String Telephone = "Telephone";

			///<summary>逻辑删除</summary>
			public const String IsDelete = "IsDelete";

			///<summary>修改时间</summary>
			public const String ModifiedOn = "ModifiedOn";

			///<summary>修改用户ID</summary>
			public const String ModifiedUserID = "ModifiedUserID";

			///<summary>修改用户</summary>
			public const String ModifiedBy = "ModifiedBy";

			///<summary>创建时间</summary>
			public const String CreateOn = "CreateOn";

			///<summary>创建用户ID</summary>
			public const String CreateUserID = "CreateUserID";

			///<summary>创建用户</summary>
			public const String CreateBy = "CreateBy";
		}

		#endregion
	}

	/// <summary>收件人信息接口</summary>
	public partial interface IConsigneeInfo
	{
		#region 属性

		/// <summary>主键</summary>
		Int32 ID { get; set; }

		/// <summary>编号</summary>
		String Code { get; set; }

		/// <summary>名称</summary>
		String Name { get; set; }

		/// <summary>地址</summary>
		String Address { get; set; }

		/// <summary>城市</summary>
		String City { get; set; }

		/// <summary>邮编</summary>
		String PostCode { get; set; }

		/// <summary>国家代码</summary>
		String CountryCode { get; set; }

		/// <summary>国家</summary>
		String Country { get; set; }

		/// <summary>联系人</summary>
		String Contact { get; set; }

		/// <summary>电话</summary>
		String Telephone { get; set; }

		/// <summary>逻辑删除</summary>
		Boolean IsDelete { get; set; }

		/// <summary>修改时间</summary>
		DateTime ModifiedOn { get; set; }

		/// <summary>修改用户ID</summary>
		Int32 ModifiedUserID { get; set; }

		/// <summary>修改用户</summary>
		String ModifiedBy { get; set; }

		/// <summary>创建时间</summary>
		DateTime CreateOn { get; set; }

		/// <summary>创建用户ID</summary>
		Int32 CreateUserID { get; set; }

		/// <summary>创建用户</summary>
		String CreateBy { get; set; }

		#endregion

		#region 获取/设置 字段值

		/// <summary>获取/设置 字段值。</summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		Object this[String name] { get; set; }

		#endregion
	}
}